#!/bin/env python3
# -*- coding:utf-8 -*-
"""
    [模块名]
    Add By : cdj <e4ting@qq.com> 2021-07-14 17:57:18
"""
import json
from flask_restful import Resource
from flask         import redirect,request,make_response

from urllib.parse import urlparse

from e4ting        import util,log
from core.cache    import RoomCache
from models.mongos import DB

# from e4ting.task   import Anon

# from core.webhook.events import EventBaitPot
# from core.webhook.hooks  import HookSender

class WebRoomNames(Resource):
    """ 房间名的候选列表 """

    def get(self, id=None):
        """ 返回肉鸡详细 """

        data = ["司礼监", "锦衣卫", "春花秋月", "内阁", "仙人掌", "花果山", "凌霄"]
        return {
            "code" : 200,
            "data"  : [
                {
                  "id": 1,
                  "name": "房间名",
                  "list": [
                        {"name": name, "id": i, "active": False, "disable": False} for i,name in enumerate(data)
                    ],
                },
                {
                  "id": "tactics",
                  "name": "牌型",
                  "list": [
                    {"name": "普通",  "id": "rand",  "active": True, "disable": False},
                    {"name": "短牌",  "id": "short", "active": False,"disable": True},
                    {"name": "同花",  "id": "flush", "active": False,"disable": True},
                    {"name": "同花顺","id": "fs",    "active": False,"disable": True},
                  ]
                }
            ]
        }
